/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "view_nota", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "ViewNota.findAll", query = "SELECT v FROM ViewNota v")})
public class ViewNota implements Serializable {
    private static final long serialVersionUID = -2391094345467663995L;

    @Id
    @Column(name = "mesano")
    private String mesano;
    @Column(name = "dat_emissao")
    @Temporal(TemporalType.DATE)
    private Date datEmissao;
    @Size(max = 200)
    @Column(name = "dsc_nfe", length = 200)
    private String dscNfe;
    @Size(max = 200)
    @Column(name = "num_os", length = 200)
    private String numOs;
    @Column(name = "dat_pagamento")
    @Temporal(TemporalType.DATE)
    private Date datPagamento;
    @Size(max = 200)
    @Column(name = "dsc_assunto", length = 200)
    private String dscAssunto;
    @Size(max = 200)
    @Column(name = "dsc_perc", length = 200)
    private String dscPerc;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "perc_etapa", precision = 10, scale = 2)
    private BigDecimal percEtapa;
    @Column(name = "vlr_proposta", precision = 18, scale = 2)
    private BigDecimal vlrProposta;
    @Column(name = "dat_venc_nota")
    @Temporal(TemporalType.DATE)
    private Date datVencNota;
    @Column(name = "vlr_liquido", precision = 18, scale = 2)
    private BigDecimal vlrLiquido;
    @Column(name = "vlr_multa", precision = 18, scale = 2)
    private BigDecimal vlrMulta;
    @Column(name = "vlr_juros", precision = 18, scale = 2)
    private BigDecimal vlrJuros;
    @Column(name = "vlr_pago", precision = 18, scale = 2)
    private BigDecimal vlrPago;
    @Size(max = 1)
    @Column(name = "ord_status", length = 1)
    private String ordStatus;
    @Size(max = 2)
    @Column(name = "tip_status", length = 2)
    private String tipStatus;
    @Size(max = 100)
    @Column(name = "nom_cliente", length = 100)
    private String nomCliente;
    @Size(max = 100)
    @Column(name = "nom_fantasia", length = 100)
    private String nomFantasia;
    @Column(name = "num_cpf")
    private String numCpf;
    @Size(max = 100)
    @Column(name = "dsc_empreendimento", length = 100)
    private String dscEmpreendimento;
    @Column(name = "num_cpf_empreendimento")
    private String numCpfEmpreendimento;
    @Size(max = 200)
    @Column(name = "nom_empresa", length = 200)
    private String nomEmpresa;

    @Transient
    private String dscStatus;
    @Transient
    private String dscOrdStatus;

    public ViewNota() {
    }

    public Date getDatEmissao() {
        return datEmissao;
    }

    public void setDatEmissao(Date datEmissao) {
        this.datEmissao = datEmissao;
    }

    public String getDscNfe() {
        return dscNfe;
    }

    public void setDscNfe(String dscNfe) {
        this.dscNfe = dscNfe;
    }

    public String getNumOs() {
        return numOs;
    }

    public void setNumOs(String numOs) {
        this.numOs = numOs;
    }

    public Date getDatPagamento() {
        return datPagamento;
    }

    public void setDatPagamento(Date datPagamento) {
        this.datPagamento = datPagamento;
    }

    public String getDscAssunto() {
        return dscAssunto;
    }

    public void setDscAssunto(String dscAssunto) {
        this.dscAssunto = dscAssunto;
    }

    public String getDscPerc() {
        return dscPerc;
    }

    public void setDscPerc(String dscPerc) {
        this.dscPerc = dscPerc;
    }

    public BigDecimal getPercEtapa() {
        return percEtapa;
    }

    public void setPercEtapa(BigDecimal percEtapa) {
        this.percEtapa = percEtapa;
    }

    public BigDecimal getVlrProposta() {
        return vlrProposta;
    }

    public void setVlrProposta(BigDecimal vlrProposta) {
        this.vlrProposta = vlrProposta;
    }

    public Date getDatVencNota() {
        return datVencNota;
    }

    public void setDatVencNota(Date datVencNota) {
        this.datVencNota = datVencNota;
    }

    public BigDecimal getVlrLiquido() {
        return vlrLiquido;
    }

    public void setVlrLiquido(BigDecimal vlrLiquido) {
        this.vlrLiquido = vlrLiquido;
    }

    public BigDecimal getVlrPago() {
        return vlrPago;
    }

    public void setVlrPago(BigDecimal vlrPago) {
        this.vlrPago = vlrPago;
    }

    public String getOrdStatus() {
        return ordStatus;
    }

    public void setOrdStatus(String ordStatus) {
        this.ordStatus = ordStatus;
    }

    public String getTipStatus() {
        return tipStatus;
    }

    public void setTipStatus(String tipStatus) {
        this.tipStatus = tipStatus;
    }

    public String getNomCliente() {
        return nomCliente;
    }

    public void setNomCliente(String nomCliente) {
        this.nomCliente = nomCliente;
    }

    public String getNomFantasia() {
        return nomFantasia;
    }

    public void setNomFantasia(String nomFantasia) {
        this.nomFantasia = nomFantasia;
    }

    public String getNumCpf() {
        return numCpf;
    }

    public void setNumCpf(String numCpf) {
        this.numCpf = numCpf;
    }

    public String getDscEmpreendimento() {
        return dscEmpreendimento;
    }

    public void setDscEmpreendimento(String dscEmpreendimento) {
        this.dscEmpreendimento = dscEmpreendimento;
    }

    public String getNumCpfEmpreendimento() {
        return numCpfEmpreendimento;
    }

    public void setNumCpfEmpreendimento(String numCpfEmpreendimento) {
        this.numCpfEmpreendimento = numCpfEmpreendimento;
    }

    public String getNomEmpresa() {
        return nomEmpresa;
    }

    public void setNomEmpresa(String nomEmpresa) {
        this.nomEmpresa = nomEmpresa;
    }

    public String getMesano() {
        return mesano;
    }

    public void setMesano(String mesano) {
        this.mesano = mesano;
    }

    public String getDscStatus() {
        if (this.tipStatus == null) {
            this.tipStatus = "8";
            this.dscStatus = "O.S. em Andamento";
        } else {
            switch (this.tipStatus) {
                case "8":
                    this.dscStatus = "O.S. em Andamento";
                    break;
                case "0":
                    this.dscStatus = "O.S. Cancelada";
                    break;
                case "A":
                    this.dscStatus = "O.S. Finalizada";
                    break;
            }
        }
        return dscStatus;
    }

    public void setDscStatus(String dscStatus) {
        this.dscStatus = dscStatus;
    }

    public String getDscOrdStatus() {
        if (this.ordStatus == null) {
            this.dscOrdStatus = "Aberto";
        } else {
            switch (this.ordStatus) {
                case "A":
                    this.dscOrdStatus = "A Faturar";
                    break;
                case "F":
                    this.dscOrdStatus = "Faturado não Pago";
                    break;
                case "P":
                    this.dscOrdStatus = "Faturado Pago";
                    break;
                case "C":
                    this.dscOrdStatus = "Cancelado";
                    break;
            }
        }
        return dscOrdStatus;
    }

    public void setDscOrdStatus(String dscOrdStatus) {
        this.dscOrdStatus = dscOrdStatus;
    }

    public BigDecimal getVlrMulta() {
        return vlrMulta;
    }

    public void setVlrMulta(BigDecimal vlrMulta) {
        this.vlrMulta = vlrMulta;
    }

    public BigDecimal getVlrJuros() {
        return vlrJuros;
    }

    public void setVlrJuros(BigDecimal vlrJuros) {
        this.vlrJuros = vlrJuros;
    }

}
